package org.szy.monitor.listener;

import org.noear.solon.annotation.Component;
import org.noear.solon.annotation.Inject;
import org.noear.solon.core.event.EventListener;
import org.szy.core.event.monitor.event.UserOffEvent;
import org.szy.monitor.service.UserOnlineService;

/**
 * 离线用户订阅事件
 *
 * @author 孙志阳
 * @date 2023-07-05
 * @since 1.0.0
 **/
@Component
public class UserOffEventListener implements EventListener<UserOffEvent> {

    @Inject
    private UserOnlineService userOnlineService;

    @Override
    public void onEvent(UserOffEvent event) {
        userOnlineService.offline(event.getToken());
    }


}
